﻿using RBOSS.Business.CustomerModule;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace RBOSS.WebUI
{
    public partial class OrderDetails : System.Web.UI.Page
    {
        private ICustomerSubSystem _customerSubSystem = new CustomerSubSystem();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["role"] != null && (string) Session["role"] == "Customer" && Session["email"] != null)
            {
                var orderDetailsId = Request.QueryString["OrderId"];
                if (orderDetailsId != null)
                {
                    var orderDetails = _customerSubSystem.GetCustomerOrderDetails(Convert.ToInt32(orderDetailsId));
                    gbOrderDetails.DataSource = orderDetails;
                    gbOrderDetails.DataBind();
                }
            }
            else
            {
                Response.Redirect("Login.aspx");
            }
           

        }

        protected void gbOrderDetails_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            gbOrderDetails.PageIndex = e.NewPageIndex;
            gbOrderDetails.DataBind();
        }
    }
}